//
//  ScoreViewController.m
//  FlowerRainGround
//
//  Created by lanou on 16/4/21.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "ScoreViewController.h"
#import "TFHpple.h"
@interface ScoreViewController ()

@end

@implementation ScoreViewController


- (void)requestData
{
  
    //1.首先将网页的html 转换成oc能认识的字符串
    NSString *string = [NSString stringWithContentsOfURL:[NSURL URLWithString:SCORE] encoding:NSUTF8StringEncoding error:nil];
    
    //将string转换成NSData 给TFHpple类用
    NSData *htmlData = [string dataUsingEncoding:NSUTF8StringEncoding];
    
    //设置html的节点
    NSString *nodeString = @"//h4";
    
    //使用htmlData 和nodeString来解析自己需要的值
    TFHpple *xathParser = [[TFHpple alloc] initWithHTMLData:htmlData];
    NSArray *array = [xathParser searchWithXPathQuery:nodeString];
    NSLog(@"html:%@",array);
}

- (void)viewDidLoad {
    [super viewDidLoad];
    //[self requestData];
    
    self.navigationItem.title = @"积分规则";
    
    
    
    
    
    
    
    
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
